package com.suse.rabbitmqspringboot.listener;

import com.suse.rabbitmqspringboot.constant.Constants;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Component
public class WorkListener {
    @RabbitListener(queues = Constants.WORK_QUEUE)
    public void queue1Listener1(Message message) {
        System.out.println("Listener 1 [" + Constants.WORK_QUEUE + "] 接收到消息: " + message);
    }

    @RabbitListener(queues = Constants.WORK_QUEUE)
    public void queue1Listener2(Message message) {
        System.out.println("Listener 2 [" + Constants.WORK_QUEUE + "] 接收到消息: " + message);
    }
}
